﻿<UserControl x:Class="SilverlightPacman.StartPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
             xmlns:lcl="clr-namespace:SilverlightPacman"
    Width="400" Height="300">
    <Grid x:Name="LayoutRoot" >
        <Grid.Resources>
            <Storyboard x:Key="sb1">
                <DoubleAnimationUsingKeyFrames Duration="0:0:5" Storyboard.TargetName="ghost1" Storyboard.TargetProperty="(Canvas.Left)">
                    <LinearDoubleKeyFrame KeyTime="0:0:1" Value="180"/>
                    <LinearDoubleKeyFrame KeyTime="0:0:2" Value="180"/>
                    <LinearDoubleKeyFrame KeyTime="0:0:3" Value="46"/>
                    <LinearDoubleKeyFrame KeyTime="0:0:4" Value="46"/>
                    <LinearDoubleKeyFrame KeyTime="0:0:5" Value="100"/>
                </DoubleAnimationUsingKeyFrames>
                <DoubleAnimationUsingKeyFrames Duration="0:0:5" Storyboard.TargetName="ghost1" Storyboard.TargetProperty="(Canvas.Top)">
                    <LinearDoubleKeyFrame KeyTime="0:0:1" Value="40"/>
                    <LinearDoubleKeyFrame KeyTime="0:0:2" Value="100"/>
                    <LinearDoubleKeyFrame KeyTime="0:0:3" Value="100"/>
                    <LinearDoubleKeyFrame KeyTime="0:0:4" Value="40"/>
                    <LinearDoubleKeyFrame KeyTime="0:0:5" Value="40"/>
                </DoubleAnimationUsingKeyFrames>
                <!-- ghost 2-->
                <DoubleAnimationUsingKeyFrames Duration="0:0:5" 
                                               BeginTime="0:0:0.4"
                                               Storyboard.TargetName="ghost2" 
                                               Storyboard.TargetProperty="(Canvas.Left)">
                    <LinearDoubleKeyFrame KeyTime="0:0:1" Value="198"/>
                    <LinearDoubleKeyFrame KeyTime="0:0:2" Value="198"/>
                    <LinearDoubleKeyFrame KeyTime="0:0:3" Value="64"/>
                    <LinearDoubleKeyFrame KeyTime="0:0:4" Value="64"/>
                    <LinearDoubleKeyFrame KeyTime="0:0:5" Value="100"/>
                </DoubleAnimationUsingKeyFrames>
                <DoubleAnimationUsingKeyFrames Duration="0:0:5" 
                                               BeginTime="0:0:0.4"
                                               Storyboard.TargetName="ghost2" 
                                               Storyboard.TargetProperty="(Canvas.Top)">
                    <LinearDoubleKeyFrame KeyTime="0:0:1" Value="40"/>
                    <LinearDoubleKeyFrame KeyTime="0:0:2" Value="100"/>
                    <LinearDoubleKeyFrame KeyTime="0:0:3" Value="100"/>
                    <LinearDoubleKeyFrame KeyTime="0:0:4" Value="40"/>
                    <LinearDoubleKeyFrame KeyTime="0:0:5" Value="40"/>
                </DoubleAnimationUsingKeyFrames>
                <!-- ghost 3-->
                <DoubleAnimationUsingKeyFrames Duration="0:0:5" 
                                               BeginTime="0:0:0.8"
                                               Storyboard.TargetName="ghost3" 
                                               Storyboard.TargetProperty="(Canvas.Left)">
                    <LinearDoubleKeyFrame KeyTime="0:0:1" Value="216"/>
                    <LinearDoubleKeyFrame KeyTime="0:0:2" Value="216"/>
                    <LinearDoubleKeyFrame KeyTime="0:0:3" Value="82"/>
                    <LinearDoubleKeyFrame KeyTime="0:0:4" Value="82"/>
                    <LinearDoubleKeyFrame KeyTime="0:0:5" Value="100"/>
                </DoubleAnimationUsingKeyFrames>
                <DoubleAnimationUsingKeyFrames Duration="0:0:5" 
                                               BeginTime="0:0:0.8"
                                               Storyboard.TargetName="ghost3" 
                                               Storyboard.TargetProperty="(Canvas.Top)">
                    <LinearDoubleKeyFrame KeyTime="0:0:1" Value="40"/>
                    <LinearDoubleKeyFrame KeyTime="0:0:2" Value="100"/>
                    <LinearDoubleKeyFrame KeyTime="0:0:3" Value="100"/>
                    <LinearDoubleKeyFrame KeyTime="0:0:4" Value="40"/>
                    <LinearDoubleKeyFrame KeyTime="0:0:5" Value="40"/>
                </DoubleAnimationUsingKeyFrames>
                <!-- ghost 4-->
                <DoubleAnimationUsingKeyFrames Duration="0:0:5" 
                                               BeginTime="0:0:1.2"
                                               Storyboard.TargetName="ghost4" 
                                               Storyboard.TargetProperty="(Canvas.Left)">
                    <LinearDoubleKeyFrame KeyTime="0:0:1" Value="234"/>
                    <LinearDoubleKeyFrame KeyTime="0:0:2" Value="234"/>
                    <LinearDoubleKeyFrame KeyTime="0:0:3" Value="100"/>
                    <LinearDoubleKeyFrame KeyTime="0:0:5" Value="100"/>
                </DoubleAnimationUsingKeyFrames>
                <DoubleAnimationUsingKeyFrames Duration="0:0:5" 
                                               BeginTime="0:0:1.2"
                                               Storyboard.TargetName="ghost4" 
                                               Storyboard.TargetProperty="(Canvas.Top)">
                    <LinearDoubleKeyFrame KeyTime="0:0:1" Value="40"/>
                    <LinearDoubleKeyFrame KeyTime="0:0:2" Value="100"/>
                    <LinearDoubleKeyFrame KeyTime="0:0:3" Value="100"/>
                    <LinearDoubleKeyFrame KeyTime="0:0:5" Value="40"/>
                </DoubleAnimationUsingKeyFrames>
            </Storyboard>
        </Grid.Resources>
        <Border CornerRadius="20" Background="Black" BorderBrush="LightYellow" BorderThickness="2" Padding="5">
            <Grid>
                <TextBlock FontFamily="CRACKMAN.TTF#CRACKMAN" FontSize="52" Text="Pacman" HorizontalAlignment="Center" Foreground="Yellow"/>
                <TextBlock FontSize="8" Text="Silverlight 2.0 RTW" HorizontalAlignment="Right" Foreground="Yellow" Margin="0,50,0,0"/>
                <TextBlock FontSize="8" Text="Pierrick Gourlain (November 2008)" HorizontalAlignment="Left" Foreground="White" Margin="0,50,0,0"/>
                <Canvas>
                    <Canvas.RenderTransform>
                        <TransformGroup>
                            <ScaleTransform ScaleX="2" ScaleY="2"/>
                            <TranslateTransform X="-40" Y="0"/>
                        </TransformGroup>
                    </Canvas.RenderTransform>
                    <lcl:GhostUC GhostColor="{StaticResource ghostColor1}" x:Name="ghost1" Canvas.Left="100" Canvas.Top="40"/>                    
                    <lcl:GhostUC GhostColor="{StaticResource ghostColor2}" x:Name="ghost2" Canvas.Left="100" Canvas.Top="40">
                        <lcl:GhostUC.RenderTransform>
                            <TranslateTransform X="-18" Y="0"/>                            
                        </lcl:GhostUC.RenderTransform>
                    </lcl:GhostUC>                    
                    <lcl:GhostUC GhostColor="{StaticResource ghostColor3}" x:Name="ghost3" Canvas.Left="100" Canvas.Top="40">
                        <lcl:GhostUC.RenderTransform>
                            <TranslateTransform X="-36" Y="0"/>                            
                        </lcl:GhostUC.RenderTransform>                        
                    </lcl:GhostUC>                    
                    <lcl:GhostUC GhostColor="{StaticResource ghostColor4}" x:Name="ghost4" Canvas.Left="100" Canvas.Top="40">
                        <lcl:GhostUC.RenderTransform>
                            <TranslateTransform X="-54" Y="0"/>                            
                        </lcl:GhostUC.RenderTransform>                                                
                    </lcl:GhostUC>
                </Canvas>
                <StackPanel VerticalAlignment="Center">
                    <TextBlock Text="Help" Foreground="White" FontFamily="CRACKMAN.TTF#CRACKMAN"/>
                    <TextBlock Margin="10,0,0,0" Text="Escape : stop game" Foreground="White"/>
                    <TextBlock Margin="10,0,0,0" Text="Arrows : move pacman" Foreground="White"/>
                    <TextBlock Margin="10,0,0,0" Text="press 'P': pause" Foreground="White"/>
                    <TextBlock Margin="10,0,0,0" Text="press 'S': activate/deactivate sound" Foreground="White"/>
                    <TextBlock Margin="10,0,0,0" Text="press 'F': full screen mode" Foreground="White"/>
                </StackPanel>
                <TextBlock FontFamily="CRACKMAN.TTF#CRACKMAN" FontSize="16" Text="Press [space] to start" Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Bottom" Margin="0,0,0,25"/>
                <TextBlock FontSize="10" Text="http://www.codeplex.com/geniuspacman" HorizontalAlignment="Left"  VerticalAlignment="Bottom" Foreground="White" Margin="0,50,0,0"/>
                <!--<Button Click="Button_Click" Content="test_sb" VerticalAlignment="Bottom" HorizontalAlignment="Left" Height="20" Width="50"/>-->
            </Grid>
        </Border>
    </Grid>
</UserControl>
